//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <cstdlib>

#include <iostream>
#include <fstream>

#include "ExtractComplexSeparated.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main(int argc, char** argv) {

  String* location;
  String* filenameListIn;
  String* locationProtein;
  String* locationLigand;

  double  distance;

  if (argc < 5) {
    cout << "Error in the input arguments. The execution must be: " << endl;
    cout << "./ExtractProteinLigandInComplexSeparatedFromPDB <Path of the folder with pdb files> <file with list of files> <path of folder to protein pdb file> <path of folder to ligand pdb file>" << endl;
    return 0;
  }
  else {
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << "             PDB Path : " << argv[1] << endl;
    cout << "   List of Input File : " << argv[2] << endl;
    cout << "Output Protein Folder : " << argv[3] << endl;
    cout << " Output Ligand Folder : " << argv[4] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    location        = new String(argv[1]);
    filenameListIn  = new String(argv[2]);
    locationProtein = new String(argv[3]);
    locationLigand  = new String(argv[4]);
  }

  ExtractComplexSeparated* extractComplexSeparated = new ExtractComplexSeparated();

  extractComplexSeparated->Location(location);
  extractComplexSeparated->ListInFilename(filenameListIn);
  extractComplexSeparated->LocationProteinOut(locationProtein);
  extractComplexSeparated->LocationLigandOut(locationLigand);

  extractComplexSeparated->GeneratedReducedDatabaseLargestLigand();

  cout << "---------------------------------------------------------------------------------" << endl;

  if (extractComplexSeparated) delete extractComplexSeparated;

  return 1;
  
}

//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
